package org.go.examples.example_07;

import java.util.List;

import org.go.Go;
import org.go.GoContext;
import org.go.expcetion.GoException;
import org.go.expcetion.WorkExecutionException;

/**
 * This task counts from 1 to 30.
 */
public class MyTask implements Go {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1790061747079010786L;

	@Override
	public Boolean doWork(GoContext context) throws WorkExecutionException {
		for (int i = 1; i <= 30; i++) {
			System.out.println("Task says: " + i);
			//context.setStatusMessage("i = " + i);
			//context.setCompleteness(i / 30D);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				;
			}
			//context.pauseIfRequested();
			//	if (context.isStopped()) {
			//	break;
			//}
		}
		return null;
	}

	@Override
	public List selectWork(String taskParameter, String ownSign, int taskItemNum, List workParamList, int eachFetchDataNum) throws GoException {
		// TODO Auto-generated method stub
		return null;
	}

}
